package util;

import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 * Created by young on 2017/6/26.
 */
public class SQLUtil {

    private static java.sql.Connection connection = JDBCutil.getConnection();

    public static int deleteInfo(String sql, int id) {
        int row = 0;
        try {
            PreparedStatement ps = connection.prepareStatement(sql);
            ps.setInt(1, id);
            row = ps.executeUpdate();
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return row;
    }
}
